Apparatus and method for providing atomicity with respect to request of write operation for successive sector

ABSTRACT

An apparatus for providing atomicity with respect to a request of a write operation for successive sectors in a flash memory is provided. The apparatus includes a data write module writing data in a main sector of a page and allocating status bits indicating a status of the data write to a spare sector of the page, a write progress managing module overwriting a commit mark in the spare sector allocated with the status bits according to a progress status of the data write, and a validity determining module determining validity of the sectors on the basis of the overwritten commit mark and providing information of the successive sectors.

CROSS REFERENCE TO RELATED APPLICATION

This application claims priority from Korean Patent Application No.10-2006-88723 filed on Sep. 13, 2006, in the Korean IntellectualProperty Office, the disclosure of which is incorporated herein byreference in its entirety.

BACKGROUND OF THE INVENTION

1. Field of the Invention

Apparatuses and methods consistent with the present invention relate toan apparatus for providing atomicity with respect to a request of awrite operation for successive sectors in a flash memory. Moreparticularly, the present invention relates to an apparatus forproviding atomicity with respect to a request of a write operation forsuccessive sectors in a flash memory and a method of providing the same,in which a data write progress status of sectors is separately displayedduring a write operation for one or more successive sectors in the flashmemory, and even when power supply is interrupted during a data writeoperation, atomicity for the write operation for one or more successivesectors is ensured on the basis of the separately displayed data writeprogress status so as to minimize the lowering in the performance of asystem.

2. Description of the Related Art

In recent years, a flash memory has been widely used in variousapplications, such as an embedded system, a mobile device, and the like,because it is nonvolatile like a hard disk, and has high access speedand low power consumption.

A flash memory based system includes a RAM that is a volatile memory, acontroller in which a CPU is built, and a flash memory that is anon-volatile memory. In this flash memory based system, since abruptpower interrupt may occur often due to characteristics of theapplication fields, file systems used in this system need to betransactional.

However, according to a general method of using a flash memory, in acase where a write operation is performed in the flash memory, even ifvarious actions that belong to one transaction are completed without anerror or an error occurs in the various actions, it is not possible toensure atomicity in which the error is processed without abnormality inthe data. As a result, in order to provide a transaction function, alarge amount of overhead is required in the file systems.

Meanwhile, when power is interrupted during a write operation for one ormore successive sectors in the flash memory, a portion of data sectorsthat request a write operation may be programmed, and the other portionmay not be programmed.

FIG. 1 is a diagram illustrating a structure of a flash memory deviceaccording to the related art.

A flash memory device 100 includes a plurality of blocks 110, and eachof the blocks 110 becomes a unit of an erasing operation of the flashmemory.

Further, each of the blocks 110 includes a plurality of pages 111, andeach of the pages 111 becomes a unit of read and write operations in theflash memory.

An operating system performs a read/write request in a sector unit, andthe page 111 of the flash memory is equal to a size of a sector or has asize that corresponds to any multiple of the size of the sector.

FIG. 2 is a diagram illustrating a write operation for one or moresuccessive sectors executed in the flash memory shown in FIG. 1.

According to the related art, in order to indicate the fact that aprogram is normally completed, as shown in FIG. 2, a status bit 202 isallocated for each sector 201, and an initial value of the status bit202 has a value of an invalid mark 0x1 (see reference numeral 202 a).

When a program for a corresponding sector is completed without powerinterruption, a status bit has a value of a valid mark 0x0 (seereference numeral 202 b).

FIG. 3 is a flowchart illustrating a process of a write operation forone or more successive sectors according to the related art.

After data is written in the sectors (Step S301), in order to indicatethe fact that a program for the sectors is completed without powerinterrupt, a valid mark 0x0 indicating the fact that a correspondingsector is valid is programmed in a status bit of the sector (Step S302).

For reference, if an initial value of the status bit has a value of aninvalid mark 0x1, a value of a valid mark, 0x0 is written.

After the process of Step S302, it is checked whether there remains asector for data to be written (Step S303), and as a result of the check,if data is written in all of the sectors, the process is completed.

As the result of the check, if there remains a sector to be written, theprocess of Step S301 is repeated.

In the embodiment shown in FIG. 2 where data is written in six sectorsincluding logical sectors 1 to 6, in Step S302, data is written in thelogical sector 1 and a valid mark is displayed in a status bitcorresponding to the logical sector 1. Then, data is written in thelogical sector 2, and a valid mark is displayed in a status bitcorresponding to the logical sector 2.

In the same manner, data is written in the logical sectors 3 to 6, and avalid mark is displayed in a status bit of each of the sectors.

FIG. 4 is a flowchart illustrating a process of inspecting validity ofsectors in a write operation for one or more successive sectorsaccording to the related art.

In the validity inspection of the sectors where the data is written, itis first determined whether a status bit of a sector is “1” (Step S401).At this time, if the status bit of the corresponding sector is not “1”,it may be assumed that the corresponding sector is determined as a validsector, and a sector program is completed (Step S402).

As a result of the process of Step S401, if the status bit of the sectoris “1”, it is assumed that the corresponding sector is determined as aninvalid sector, and the sector program is not completed (Step S403).

As described above, the following problems exist in the related art.When power interrupt occurs during a write operation for one or moresuccessive sectors, a portion of the sectors may be determined as validsectors, and a portion of the sectors may be determined as invalidsectors. As a result, it is not possible to ensure atomicity for a writeoperation for one or more successive sectors.

SUMMARY OF THE INVENTION

An object of the invention is to provide an apparatus for providingatomicity with respect to a request of a write operation for successivesectors in a flash memory and a method of providing the same, which arecapable of ensuring atomicity for a write operation for successivesectors and minimizing the lowering in the performance of a system, evenwhen power interrupt occurs during the write operation for one or moresuccessive sectors in the flash memory.

Objects of the invention are not limited to the above-mentioned objects,and other objects of the invention will be apparently understood bythose skilled in the art through the following description.

According to an aspect of the present invention, there is provided anapparatus for providing atomicity with respect to a request of a writeoperation for successive sectors in a flash memory, the apparatusincluding: a data write module writing data in a main sector of a pageand allocating status bits indicating a status of the data write to aspare sector of the page, a write progress managing module overwriting acommit mark in the spare sector allocated with the status bits,according to a progress status of the data write, and a validitydetermining module determining validity of the sectors on the basis ofthe overwritten commit mark and providing information of the successivesectors.

According to another aspect of the present invention, there is provideda method of providing atomicity with respect to a request of a writeoperation for successive sectors in a flash memory, the methodincluding: writing data in a main sector of a page and allocating statusbits indicating a status of the data write to a spare sector of thepage, overwriting a commit mark in the spare sector allocated with thestatus bits, according to a progress status of the data write, anddetermining validity of the sectors on the basis of the overwrittencommit mark and providing information of the successive sectors.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other features and advantages of the invention will becomemore apparent by describing in detail preferred embodiments thereof withreference to the attached drawings in which:

FIG. 1 is a diagram illustrating a structure of a flash memory deviceaccording to the related art;

FIG. 2 is a diagram illustrating a conventional embodiment of a writeoperation for one or more successive sectors executed in a flash memoryshown in FIG. 1;

FIG. 3 is a flowchart illustrating a process of a write operation forone or more sectors according to the related art;

FIG. 4 is a flowchart illustrating a process of inspecting validity of asector in a write operation for one or more successive sectors accordingto the related art;

FIG. 5 is a block diagram illustrating a structure of an apparatus forproviding atomicity with respect to a request of a write operation forsuccessive sectors in a flash memory according to an exemplaryembodiment of the invention;

FIG. 6 is a diagram illustrating a format of a status bit allocated foreach sector in an apparatus according to an exemplary embodiment of theinvention;

FIG. 7 is a flowchart illustrating a process of a write operation forone or more successive sectors according to an exemplary embodiment ofthe invention;

FIG. 8 is a diagram illustrating a relationship between a unit of aphysical unit managed in a FTL (Flash Translation Layer) and a physicalblock of a flash device;

FIG. 9 is a diagram illustrating a write operation for one or moresuccessive sectors in a small-block flash memory according to anexemplary embodiment of the invention;

FIGS. 10A to 10B are diagrams illustrating a write operation for one ormore successive sectors in a small-block flash memory according to anexemplary embodiment of the invention;

FIG. 11 is a diagram illustrating a case in which power interrupt occursduring a write operation for one or more successive sectors in a largeblock according to an exemplary embodiment of the invention; and

FIG. 12 is a diagram illustrating a write operation for one or moresuccessive sectors in a large-block flash memory according to anexemplary embodiment of the invention.

DESCRIPTION OF THE EXEMPLARY EMBODIMENTS

Advantages and features of the invention and methods of accomplishingthe same may be understood more readily by reference to the followingdetailed description of exemplary embodiments and the accompanyingdrawings.

The invention may, however, be embodied in many different forms andshould not be construed as being limited to the embodiments set forthherein. Rather, these exemplary embodiments are provided so that thisdisclosure will be thorough and commit and will fully convey the conceptof the invention to those skilled in the art, and the invention willonly be defined by the appended claims. Like reference numerals refer tolike elements throughout the specification.

The present invention will be described hereinafter with reference toblock diagrams or flowchart illustrations of a method and an apparatusfor providing atomicity with respect to a request of a write operationfor successive sectors in a flash memory according to an exemplaryembodiment thereof.

It will be understood that each block of the flowchart illustrations,and combinations of blocks in the flowchart illustrations can beimplemented by computer program instructions.

These computer program instructions can be provided to a processor of ageneral purpose computer, special purpose computer, or otherprogrammable data processing apparatus to produce a machine, such thatthe instructions, which execute via the processor of the computer orother programmable data processing apparatus, create means forimplementing the functions specified in the flowchart block or blocks.

These computer program instructions may also be stored in a computerusable or computer-readable memory that can direct a computer or otherprogrammable data processing apparatus to function in a particularmanner, such that the instructions stored in the computer usable orcomputer-readable memory produce an article of manufacture includinginstruction means that implement the function specified in the flowchartblock or blocks.

The computer program instructions may also be loaded onto a computer orother programmable data processing apparatus to cause a series ofoperations to be performed on the computer or other programmableapparatus to produce a computer implemented process such that theinstructions that are executed on the computer or other programmableapparatus provide for implementing the functions specified in theflowchart block or blocks.

Further, each block of the block diagrams may represent a module,segment, or portion of code, which comprises one or more executableinstructions for implementing the specified logical function(s).

It should also be noted that in some alternative implementations, thefunctions noted in the blocks may occur out of order.

For example, two blocks shown in succession may in fact be executedsubstantially concurrently or the blocks may sometimes be executed inreverse order depending upon the functionality involved.

The present invention will now be described more fully with reference tothe accompanying drawings, in which preferred embodiments of theinvention are shown.

FIG. 5 is a diagram illustrating a structure of an apparatus forproviding atomicity with respect to a request of a write operation forsuccessive sectors in a flash memory according to an embodiment of theinvention.

An apparatus for providing atomicity with respect to a request of awrite operation for successive sectors in a flash memory according to anexemplary embodiment of the invention includes a data write module 501that writes data in a main sector of a page and allocates a status bitindicating a data write status to a spare sector of the page, a writeprogress managing module 502 that overwrites commit mark in the sparesector to which the status bit is allocated according to a progressstatus of the data write operation, a validity determining module 503that determines validity of the corresponding sector on the basis of theoverwritten commit mark and provides information of successive sectors,and a control module 504 that controls various modules.

Meanwhile, the term “module” used in the embodiment of the inventionmeans software, or a hardware component such as an FPGA (FieldProgrammable Gate Array) or an ASIC (Application Specific IntegratedCircuit) and the modules each perform allocated functions.

However, the modules are not limited to software or hardware.

The modules may be configured in an addressable storage medium, or maybe configured to run on at least one processor.

Therefore, as an example, the modules include: components such assoftware components, object-oriented software components, classcomponents, and task components; processors, functions, attributes,procedures, sub-routines, segments of program codes, drivers, firmware,microcodes, circuits, data, databases, data structures, tables, arrays,and variables.

The functions provided by the components and the modules may be combinedinto fewer components and modules or may be separated into additionalcomponents and modules.

The data write module 501 sequentially writes data in a main sectoravailable in a block, and at the same time, allocates a bit indicating aprogressing status of a data write operation, that is, a status bit to aspare sector in the block.

FIG. 6 is a diagram illustrating a format of a status bit allocated foreach sector in the data write module 501 that is a device according toan exemplary embodiment of the invention.

A status bit allocated for each main sector 601 in the data write module501 may have a commit value 0x00000000, an uncommit value 0x1110000, ora free value 0x11111111, and each of the status bits is used to indicatewhether each main sector 601 is valid.

Further, a status of a status bit is changed in order of a free status,an uncommit status, and a commit status.

For reference, in a NAND flash memory, when a bit status is changed from“1” to “0”, the bit status cannot be changed again to “1” until thewritten data is erased. The status bit values “0x00000000 (commit)”,“0x11110000 (uncommit)”, and “0x11111111 (free)” that are used in thisinvention are exemplary, and the invention is not limited thereto.

The write progress managing module 502 overwrites a commit mark in thespare sector 602 to which the status bit is allocated according to aprogress status of a data write operation.

According to a write operation for one or more successive sectors ofthis invention, the data write module 501 writes both data and a statusbit by a write operation.

However, when a write operation is completed, the data write module 501does not display a commit mark, and the write progress managing module502 checks a data write progress status, and only allocates a commitmark to a sector where data is finally written.

FIG. 7 is a flowchart illustrating a process of a write operation forone or more successive sectors according to an exemplary embodiment ofthe invention.

The data write module 501 writes data in a specific sector and displaysan uncommit mark so as to indicate the fact that the data write is notcompleted (S701).

After the process of S701, the write progress managing module 502determines whether the data write module 501 writes all of the data andthe status bit to be written in a corresponding sector (S702). In thiscase, as a result of the determination, if the data write module 501writes all of the data and the status bit in the corresponding sector,the write progress managing module 502 overwrites a status bit of anN-th spare sector with a commit mark (S703).

As a result of the process of S702, if there remains a sector where datais written, the processes from S701 are repeated.

For reference, in the flash memory, an erase-before-write operation isperformed because of physical characteristics. According to thisoperation, when the data write module 501 performs a write operation ina sector, data of a block to which the corresponding sector belongs iserased by an erase operation, and a write operation is performed in thecorresponding sector.

Thus, a large amount of time may be required for the same I/O, ascompared with a hard disk that can perform an overwrite operation in asector.

Further, if an erase operation is performed in a block of the flashmemory one hundred thousand of times, the erase operation cannot beperformed any more in the block of the flash memory.

Accordingly, the erase operation shortens a life span of the flashmemory.

Because of this characteristic, if a write operation is performed for aspecific sector of the flash memory, an available block or a block, inwhich the number of times an erase operation that has been performed issmall, is allocated in the flash memory, and a write operation isperformed in the corresponding block.

Software that performs this function is referred to as a flashtranslation layer (hereinafter, simply referred to as FTL), whichperforms a function for mapping a sector number of a file system with asector number of a flash memory.

An FTL algorithm should perform this erase operation as rarely aspossible, and the erase operation should not be concentrated on oneblock.

FIG. 8 is a diagram illustrating a relationship between a physical unitmanaged by the FTL and a physical block of a flash device.

A physical unit 810 includes a predetermined number of successivephysical blocks 811. In the FTL, an erase unit is the physical unit 810,and a read/write unit is a sector unit.

Meanwhile, the validity determining module 503 determines the validityof sectors on the basis of a commit mark overwritten by the writeprogress managing module 502, and provides information of the successivesectors. A reference of the validity determination will be described indetail below.

Meanwhile, the flash memory may be divided into a small-block flashmemory where one sector exists in one page and a large-block flashmemory where two or more sectors exist in one page (in a current generalflash memory, four sectors exist in one page).

In addition, a method of writing data in flash memory blocks accordingto a write algorithm of flash memory software may be divided into amethod of sequentially writing data first in available sectors, and amethod of writing data in a sector at an intermediate location of aflash memory.

A basic algorithm of this invention may be applied to the method ofsequentially writing data first in available sectors.

In this invention, when a physical unit where data is written through apredetermined mapping process of a FTL according to a request of asuccessive logical write operation is determined, it is assumed that thefact that the number of free sectors capable of stratifying the logicalwrite request always exists in the corresponding physical unit isensured by the mapping process of the FTL.

FIG. 9 is a diagram illustrating a write operation for one or moresuccessive sectors in a small-block flash memory according to anexemplary embodiment of the invention where one sector can be stored inone page.

It is assumed that a physical sector status of a physical unit becominga subject of a logical sector write request is a free status from asector 1.

A method of writing data in six sectors 901 a to 901f including thesectors 1 to 6 is based on a flowchart shown in FIG. 7.

The data write module 501 writes data in the sectors 1 to 6, that is,the sectors 901 a to 901 f, and displays uncommit marks in status bitsthereof

If the data write is completed, the write progress managing module 502performs a page write operation seven times on only the sector 6, thatis, the sector 901f where a data write operation is finally performed,according to a method of overwriting a commit mark in a status bit 902.

The status bit 902 of the logical sector 6, that is, the logical sector901 f passes through a process of a free (0x11111111) status, anuncommit (0x11110000) status, and a commit (0x00000000) status.

A validity determination reference of the validity determining module503 will now be described in detail below with reference to FIGS. 10 to11.

The validity determination for sectors where data has been written isperformed for each physical unit.

First, according to a sector mapping method of an FTL, the validitydetermining module 503 searches a physical unit including sectors wheredata has been written and checks validity on each of the sectors from aphysical sector 0 to a final sector in the corresponding physical unit.

In this case, according to the reference of the validity check, when astatus of a specific sector is “free”, all sectors between a sectorright subsequent to a sector where a commit mark is most recentlydisplayed and a current sector may be determined as invalid sectors.

When the status bit of the specific sector indicates “uncommit”, “valid”sectors or “invalid” sectors are determined according to status bits ofsectors subsequent to the corresponding sector.

When the status bit of the specific sector indicates “commit”, allsectors between a sector right subsequent to a sector where a commitmark is most recently displayed and a current commit sector may bedetermined as valid sectors.

When the status bit of the current sector is neither “commit” nor“uncommit”, all sectors between a sector right subsequent to a sectorwhere a “commit” mark is most recently displayed and a current sectormay be assumed as “invalid” sectors.

In a small-block flash memory shown in FIG. 9, a “commit” mark is notdisplayed in the logical sectors 1 to 5, that is, the logical sectors901 a to 901 e, but a “commit” mark is displayed in the logical sector6, that is, the logical sector 901 f.

Accordingly, all of the logical sectors 1 to 6, that is, the logicalsectors 901 a to 901 f may be determined as valid sectors.

That is, the data write module 501 sequentially writes data fromavailable main sectors, and the write progress managing module 502displays a commit mark when data write is completed. Accordingly, evenwhen an uncommit mark is displayed in a current sector, a current sectormay be assumed as a valid sector if a sector where a “commit” mark isdisplayed exists in the next pages. The sector where the “commit” markis displayed is also a valid sector.

In this case, however, sectors between a current sector and a sectorwhere a commit mark is displayed until the sector where the commit markis displayed is discovered need to be sectors where an uncommit mark isdisplayed.

FIGS. 10A and 10B are diagrams illustrating a case where power interruptoccurs during a write operation for one or more successive sectors in asmall-block flash memory.

It is assumed that a write operation for logical sectors 1 and 2 and awrite operation for logical sectors 3 to 8 are requested through twosuccessive sector write operations.

FIG. 10A shows a state where data is completely written in first andsecond logical sectors 1001 a and 1001 b by a first write operation forsuccessive sectors, and a power interrupt occurs right after the datawrite module 501 writes data in the seventh sector 1001 g and displaysan uncommit mark during a write operation for successive sectors isperforming on the third to seventh sectors 1001 c to 1001 g.

In this case, the validity determination by the validity determiningmodule 503 starts from a first physical sector of a physical unit thathas corresponding data.

The status bit 1002 is in an “uncommit” status in the first sector 1001a, while the status bit 1002 is in a “commit” status in a second sector1001 b. Therefore, the first and second sectors 1001 a and 1001 b aredetermined as valid sectors.

Since all of the status bits 1002 of the third to seventh sectors 1001 cto 1101 g are in an “uncommit” status, determination whether thecorresponding sectors are “valid” or “invalid” is reserved.

The validity determining module 503 checks the status bits 1002 ofsectors until the seventh sector 1001 g, and then checks the status bit1002 of the eighth sector 1001 h.

As a result of the check, if the status bit 1002 of the eighth sector1001 h is “free”, all of the third to seventh sectors 1001 c to 1001 gare determined as “invalid” sectors.

FIG. 10B shows a state where power interrupt occurs while the data writemodule 501 writes data in the eighth sector 1003 h in a second writeoperation for successive sectors and displays its status bit 1004 withan “uncommit” mark.

The eighth sector 1003 h is a final sector among sectors where a writeoperation for successive sectors is requested. Accordingly, if a writeoperation progresses in a normal state, the data is written in theeighth sector 1003 h by the data write module 501, its status bit 1004is displayed by “uncommit” mark, and a “commit” mark is overwritten inthe status bit 1004 by the write managing progress module 502.

However, since the status bit 1004 may be different according to a timepoint of when power supply is interrupted, a bit status of the eighthsector 1003 h is displayed as an unstable status.

In this case, an “unstable” status means that the status bit does notbelong to either an “uncommit” status or a “commit” status due to abruptpower interruption.

At this time, since power supply is interrupted while displaying an“uncommit” mark 0x11110000, the status bit 1004 cannot be displayed by acommit mark 0x00000000.

The validity determination by the validity determining module 503 is thesame as that having been described with reference to FIG. 10A.

When the eighth sector 1003 h is verified by the validity determiningmodule 503, the status bit 1004 of the eighth sector 1003 h does notindicate “a commit” status, and thus the third to eighth sectors 1003 cto 1003 h are determined as “invalid” sectors.

FIG. 11 is a diagram illustrating a write operation for one or moresuccessive sectors in a large-block flash memory according to anexemplary embodiment of the invention where four sectors can be storedin one page.

A write operation is performed for successive sectors until the first totenth logical sectors 1101 a to 1101 j, and a write operation isperformed for successive sectors until thirtieth to forty second sectors1110 k to 1101 w.

Accordingly, the data write module 501 writes data in the logicalsectors until the first to tenth logical sectors 1101 a to 1101 j, anddisplays an “uncommit” mark.

In addition, the write progress managing module 502 overwrites a“commit” mark in a status bit of the final logical sector, that is, afinal logical sector 1101 j.

Then, the data write module 501 writes data in the logical sectors untilthe thirtieth to forty second logical sectors 1101 k to 1101 w, anddisplays an “uncommit” mark.

In addition, the write progress managing module 502 overwrites a“commit” mark in a status bit 1102 of the final logical sector, that is,the forty second logical sector 1101 w.

As such, the validity determination by the validity determining module502 for the sectors where data has been written by requesting a writeoperation for successive sectors twice, that is, the first to tenthsectors 1101 a to 1101 j and the thirtieth to forty second 1101 k to1101 w is determined by the same method as the case in a small blockthat has been described with reference to FIGS. 9 to 10B.

FIG. 12 is a flowchart illustrating a method of inspecting thevalidation of sectors in an apparatus according to an exemplaryembodiment of the invention.

The validity determining module 503 initializes the number of sectorswhose validity is determined (hereinafter, referred to as Temp) and aphysical sector number to “0” (S1201).

After the process of S1201, sectors are checked in order of physicalsector numbers (S1202).

After the process of S1202, it is checked whether the status bit of thesector is free (S1203).

As a result of the process of S1203, if the status bit of the sector is“free”, the checked sectors are determined as invalid sectors (S1204).

As a result of the process of S1203, if the status bit of the sector isnot “free”, it is checked whether the status bit of the sector is“uncommit” (S1205).

As a result of the process of S1205, if the status bit of the sector is“uncommit”, it is determined according to a status bit of a next sectorwhether the currently checked sectors are valid or invalid. Therefore, aphysical sector number to be checked and the number of sectors whosevalidity are determined is increased by 1 (S1206), and the process ofS1203 is repeated.

As a result of the process of S1205, if the status bit of the sector isnot “uncommit”, it is checked whether the status bit of the sector is“commit” (S1207).

As a result of the process of S1207, if the status bit of the sector is“commit”, the checked sectors until now are determined as valid sectors,and the number of the currently checked sectors is initialized to 0(S1208).

As a result of the process of S1207, if the status bit of the sector isnot “commit”, the currently checked sectors are determined as invalidsectors.

After the process of S1208, it is checked whether a physical sectornumber of the finally checked sector corresponds to an end of thephysical unit (S1209). In this case, if the physical sector number ofthe finally checked sector corresponds to the end of the physical unit,a validity inspection of the sectors is completed, and if the physicalsector number of the finally checked sector does not correspond to theend of the physical unit, the process of S1202 is repeated whileincreasing a physical sector number.

Although the present invention has been described in connection with theexemplary embodiments of the present invention, it will be apparent tothose skilled in the art that various modifications and changes may bemade thereto without departing from the scope and spirit of theinvention. Therefore, it should be understood that the above embodimentsare not limitative, but illustrative in all aspects.

According to an apparatus for providing atomicity with respect to arequest of a write operation for successive sectors in a flash memoryaccording to an exemplary embodiment of the invention and a method ofproviding the same, the following effect can be achieved.

Even when power supply is interrupted during a write operation for oneor more successive sectors in a flash memory, atomicity can be ensuredin which all of the data sectors where a write operation is requestedare read or not read, which minimizes the lowering in the performance ofa system.

1. An apparatus for providing atomicity with respect to a request of a write operation for successive sectors in a flash memory, the apparatus comprising: a data write module which writes data in a main sector of a page and which allocates status bits indicating a status of the data write to a spare sector of the page; a write progress managing module which overwrites a commit mark in the spare sector allocated with the status bits, according to a progress status of the data write; and a validity determining module which determines validity of the successive sectors on a basis of the overwritten commit mark and which provides information regarding the successive sectors.
 2. The apparatus of claim 1, wherein the data writing module sequentially writes the data and the status bits in available sectors.
 3. The apparatus of claim 1, wherein the data write module allocates an uncommit status to the status bit.
 4. The apparatus of claim 1, wherein the validity determining module determines validity of the sectors in a unit of a physical unit.
 5. The apparatus of claim 1, wherein, if a status bit of a specific sector is free, the validity determining module determines, as invalid sectors, sectors between a sector in which a commit mark is most recently displayed and the specific sector.
 6. The apparatus of claim 1, wherein, if a status bit of a specific sector is uncommit, the validity determining module determines validity of the specific sector according to status bits of sectors subsequent to the specific sector.
 7. The apparatus of claim 6, wherein, if the status bit of the sector subsequent to the specific sector is commit, the validity determining module determines that sectors between the specific sector and the previous sector in which the status bit is commit are valid.
 8. The apparatus of claim 6, wherein, if the status bit of the sector subsequent to the specific sector is neither commit or uncommit, the validity determining module determines, as invalid sectors, sectors between a sector in which a commit mark is most recently displayed and a current sector.
 9. A method of providing atomicity with respect to a request of a write operation for successive sectors in a flash memory, the method comprising: writing data in a main sector of a page and allocating status bits indicating a status of the data write to a spare sector of the page; overwriting a commit mark in the spare sector allocated with the status bits, according to a progress status of the data write; and determining validity of the successive sectors on a basis of the overwritten commit mark and providing information regarding the successive sectors.
 10. The method of claim 9, wherein, in the writing of data in the main sector of the page and the allocating of the status bits indicating the status of the data write to the spare sector of the page, the data and the status bits are sequentially written in available sectors.
 11. The method of claim 9, wherein, in the writing of data in the main sector of the page and the allocating of the status bits indicating the status of the data write to the spare sector of the page, an uncommit status is allocated to the status bit.
 12. The method of claim 9, wherein, in the determining of the validity of the sectors on the basis of the overwritten commit mark and the providing of information of the successive sectors, validity of the sectors is determined in a unit of a physical unit.
 13. The method of claim 9, wherein, in the determining of the validity of the sectors on the basis of the overwritten commit mark and the providing of information of the successive sectors, if a status bit of a specific sector is free, sectors between a sector in which a commit mark is most recently displayed and the specific sector are determined as invalid sectors.
 14. The method of claim 9, wherein, in the determining of validity of the sectors on the basis of the overwritten commit mark and the providing of information of the successive sectors, if a status bit of a specific sector is uncommit, validity of the specific sector is determined according to status bits of sectors subsequent to the specific sector.
 15. The method of claim 14, wherein, in the determining of validity of the sectors on the basis of the overwritten commit mark and the providing of information of the successive sectors, if the status bit of the sector subsequent to the specific sector is commit, sectors between the previous sector in which a commit mark is displayed and the specific sector are determined as valid sectors.
 16. The method of claim 14, wherein, in the determining of validity of the sectors on the basis of the overwritten commit mark and the providing of information of the successive sectors, if a status bit of the sector subsequent to the specific sector is neither commit or uncommit, sectors between a sector in which a commit mark is most recently displayed and a current sector are determined as invalid sectors. 